﻿using System.Linq;
using System.Collections.ObjectModel;
using TestRunner.App.Entities;

namespace TestRunner.App.Model
{
    public class ModelReal : IModel
    {
        public ObservableCollection<Customer> GetAllCustomers()
        {
            ObservableCollection<Customer> c = new ObservableCollection<Customer>();

            c.Add(new Customer() { ID = 1, FirstName = "Tim", LastName = "Heuer" });
            c.Add(new Customer() { ID = 2, FirstName = "Scott", LastName = "Guthrie" });
            c.Add(new Customer() { ID = 3, FirstName = "Steve", LastName = "Ballmer" });

            return c;
        }

        public Customer GetCustomer(int id)
        {
            var cust = from c in GetAllCustomers()
                       where c.ID == id
                       select c;

            return cust.First();
        }
    }
}
